package cn.anjubao.cp.api.config.security;

import com.anjubao.parking.municipal.user.dto.UserInfoDto;
import org.springframework.security.authentication.AbstractAuthenticationToken;

public class UserToken extends AbstractAuthenticationToken {

    private String userCode;

    private UserInfoDto userInfoDto;

    public UserToken(String userCode) {
        super(null);
        this.userCode = userCode;
    }

    public UserToken(UserInfoDto userInfoDto) {
        super(null);
        this.userInfoDto = userInfoDto;
    }

    @Override
    public Object getCredentials() {
        return this.userCode;
    }

    @Override
    public Object getPrincipal() {
        return null;
    }

    public UserInfoDto getUserInfo(){return this.userInfoDto;}
}
